﻿@model BBFormViewModel
@{
    ViewData["Menu"] = 8;
    ViewData["Title"] = Model.id > 0 ? "修改信息" : "发布信息（超管）";
    List<BB_flpx> BBFL = ViewBag.Categories as List<BB_flpx>;
}

<!--页面主要内容-->
<main class="ftdms-layout-content">
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        @using (Html.BeginForm(FormMethod.Post, true, new { @class = "site-form" }))
                        {
                            @Html.HiddenFor(m => m.id)
                            <div class="input-group m-b-10">
                                <span class="input-group-addon">分类</span>
                                @Html.DropDownListFor(m => m.fbfl,BBFL.Select(l => new SelectListItem(){ Text = l.flmc, Value = l.id.ToString(), Selected = l.id == Model.fbfl }), null, new { @class="form-control", @required="required" })
                            </div>
                            <div class="input-group m-b-10">
                                <span class="input-group-addon">标题</span>
                                @Html.TextBoxFor(m => m.fbbt, new { @class="form-control", @required="required" })
                            </div>
                            <textarea id="editor" name="fblr" rows="5" required="required" style="display: none;">@* hynosql *@ @(Model.fblr)</textarea>
                            <br>
                            <button type="submit" class="btn btn-primary" onclick="he.sync()">发布</button>
                            <button type="button" class="btn btn-default" onclick="javascript:history.go(-1);">返回</button>
                        }
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
<!--End 页面主要内容-->

<script src="~/lib/textEditor/HandyEditor.min.js"></script>
<script type="text/javascript">
    var he = HE.getEditor('editor',{
      height : '600px',//设置编辑器高度，若不设置，则编辑器宽度自适应
      autoHeight : false,//编辑框是否自动增长
      autoFloat : true,//工具栏是否浮动false
      topOffset : 10,//工具栏浮动时，距离浏览器顶部的距离，用于某些具有固定头部的页面
      uploadPhoto : true,//是否开启本地图片上传
      uploadPhotoHandler : '@Url.Action("Editor","Upload")',//本地图片上传后服务器端的执行文件
      uploadPhotoSize : 1024 * 5,//5m 可上传的本地图片最大的大小，0为不限制上传大小，单位为KB
      uploadPhotoType : 'jpg,jpeg,gif,png',//上传的本地图片类型
      uploadPhotoSizeError : '不能上传大于5m的图片',
      uploadPhotoTypeError : '只能上传gif,png,jpg,jpeg格式的图片',
      uploadParam:{},//上传图片时，同时传递给后台的参数
      lang : 'zh-jian',//使用的语言
      skin : 'HandyEditor',//编辑器使用的皮肤
      externalSkin : '',//外部皮肤文件
      item : ['bold','italic','strike','underline','fontSize','fontName','paragraph','color','backColor','|','center','left','right','full','indent','outdent','|','link','unlink','textBlock','code','selectAll','removeFormat','trash','|','image','expression','subscript','superscript','horizontal','orderedList','unorderedList','|','undo','redo','|','html'] //工具栏显示的内容
    });
</script>